package com.spark.common.core.entity.system;

import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.common.annotation.Dict;
import com.spark.common.annotation.query.Query;
import com.spark.common.constants.QueryConstants;
import com.spark.common.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 系统参数配置类型
 *
 * @author LYCHEE
 * @date 2025/03/22 11:08
 */
@Data
@TableName("sys_params_type")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SysParamsType extends BaseEntity {

    /**
     * 分类名称
     */
    @Query(QueryConstants.QUERY_LIKE)
    @NotBlank(message = "分类名称不能为空")
    private java.lang.String belongKeyTitle;

    /**
     * 分类key
     */
    @Query(QueryConstants.QUERY_EQ)
    @NotBlank(message = "分类key不能为空")
    private java.lang.String belongKey;

    /**
     * 状态
     */
    @Query(QueryConstants.QUERY_EQ)
    @NotNull(message = "状态不能为空")
    @Dict(dictCode = "status")
    private java.lang.Integer status;

    /**
     * 排序
     */
    @OrderBy(asc = true, sort = 3)
    private java.lang.Integer sortRank;

    /**
     * 参数项
     */
    @TableField(exist = false)
    private List<SysParams> params;
}
